<?php

class  Somi_Models_Laufendenr extends Zend_Db_Table_Abstract 
{
	protected $_name='laufendenr';
	protected $_primary = 'laufendenr_id';
	#protected $_rowClass = 'user';
	protected $_sequence  = true;
	#protected $_dependentTables = array('email');
	
	
	public function getlastnumber(){
		$select=$this->select();
		$select->from('laufendenr');
		$select->where('datum="'.date('Y-m-d').'"');
		$select->order('tageszahl DESC');
		$select->limit(1);
		#echo $select;
		return $this->fetchAll($select);
	}
	
	public function setlastnumber($tageszahl){
		$row=$this->createRow();
		$row->tageszahl=$tageszahl;
		$row->datum= date('y.m.d');
		$row->save();
	}
	
	
}

?>